package com.szrt.day20170411.ch02;

public class Teacher {
	
	/**
	 * 年龄
	 */
	private int age;
	
	/**
	 * 薪资
	 */
	private double salary;
	
	
	
	/**
	 * 姓名
	 */
	private String name;
	

	public Teacher(){
		System.out.println("调用了默认的构造方法...");
	}
	
	//set/get 一定要用代码生成器去生产 不允许自己写  不允许生成后去修改它的代码  在工作中只允许用它默认的  画蛇添足
	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public double getSalary() {
		return salary;
	}

	public void setSalary(double salary) {
		this.salary = salary;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		
		/*if(name == null){
			
		}*/
		this.name = name;
	}


	@Override
	public String toString() {
		return "Teacher [age=" + age + ", salary=" + salary + ", name=" + name + "]";
	}
	
	
	/**
	 * 加法
	 * @param x
	 * @param y
	 * @return
	 */
	public static int add(int x, int y){
		return x+y;
	}
	
	
	
	public static void main(String[] args) {
		Teacher name = new Teacher();
		name.setAge(33);
		System.out.println(name.age);;
	}
	
	
	
	

}
